#ifndef STUDENTINFOWIDGET_H
#define STUDENTINFOWIDGET_H

#include <QWidget>
#include <QByteArray>
#include <QTableWidgetItem>
class QGroupBox;

namespace Ui {
class StudentInfoWidget;
}

class StudentInfoWidget : public QWidget
{
    Q_OBJECT

public:
    explicit StudentInfoWidget(QWidget *parent = nullptr);
    ~StudentInfoWidget();

private slots:
    void on_btnAdd_clicked();

    void on_btnDeleteItem_clicked();

    void on_btnDeleteLine_clicked();

private:
    Ui::StudentInfoWidget *ui;

    QByteArray photoData;

    QGroupBox* createFormGroup();
    QGroupBox* createPhotoGroup();
    void handleDialogAccepted(QGroupBox* formGroup,QGroupBox* photoGroup);
    void handleItemChanged (QTableWidgetItem* item);
public:
    void refreshTable();
};

#endif // STUDENTINFOWIDGET_H
